<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>注册</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	
	<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
	<link href="css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
	<link href="css/templatemo_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="cpts_169_dcw/js/jquery-3.2.1.js"></script>
<script type="text/javascript">
    $(function(){
    	$('#getCode').click(function(){
        	$('#method').attr("value","getCode");
        	document.form.submit();
    	});
    	$('#regist').click(function(){
        	$('#method').attr("value","regist");
        	document.form.submit();
    	});
    });
    
</script>

</head>
<body class="templatemo-bg-gray">
	<h1 class="margin-bottom-15">注册</h1>
	<div class="container">
		<div class="col-md-12">		
			<form id="form" name="form" class="form-horizontal templatemo-create-account templatemo-container" role="form" action="<c:url value='/UserServlet'/>" method="post">  
			    <input type='hidden' name='method' id="method"/>
				<div class="form-inner">
		            <p style="color: red; font-weight: 900">${msg }</p>	
					<div class="form-group">
			          <div class="col-md-6">		          	
			            <label for="first_name" class="control-label">用户名</label>
			            <input type="text" class="form-control" name="username" id="username" value="${form.username }${username }">
			            <span style="color: red; font-weight: 900">${errors.username }</span><br/>	
			                           
			            <label for="password" class="control-label">密码</label>
			            <input type="password" class="form-control" name="password" id="password" value="${form.password }${password }">
			            <span style="color: red; font-weight: 900">${errors.password }</span><br/>	  
			            
			            <label for="password" class="control-label">确认密码</label>
			            <input type="password" class="form-control" name="password1" id="password1" value="${password1 }">
			            <span style="color: red; font-weight: 900">${errors.password1 }</span>  <br/>	         		            		            
			          </div>
			          <div class="col-md-6">		          	
			            <label for="last_name" class="control-label" >邮箱</label>
			            <input type="text" class="form-control" name="email" id="email" value="${form.email }${email }">	
			            <span style="color: red; font-weight: 900">${errors.email }</span><br/>	
			                  	
			            <label for="last_name" class="control-label">验证码</label>
			            <input type="text" class="form-control" name="code">	
			            <span style="color: red; font-weight: 900">${errors.code }</span><br/>	  
			            <br/>   
			            
			            <input type="button" id="getCode" class="btn btn-danger" value="验证码"><font style="color: red; font-weight: 900">${emailerror }</font>
			            <br/>         		            		            
			          </div>
			        </div>
			        <div class="form-group">
			          <div class="col-md-12">
			            <input type="button" id="regist" value="注册" class="btn btn-info">
			            <a href="login.jsp" class="pull-right">登陆</a>
			          </div>
			        </div>	
				</div>				    	
		      </form>		      
		</div>
	</div>
	<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
</body>
</html>